package com.annet.token.dto.error;

/**
 * @author:PanLin
 * @date: 2018/6/5
 */
public enum ErrorCode {
    /**
     * 11111 自定义code
     */

    DATA_INCONSISTENCY(10000, "数据不统一"),
    UNAUTHORIZED_OPERATION(10001, "越权操作"),
    TOKEN_SIGN_ERROR_OR_EXPIRY(10004, "登录授权过期，请重新授权登录"),
    CONCURRENT_REQUEST_MSG(10005, "上次请求正在处理中，请勿频繁点击"),

    FUNCTION_IS_NOT_OPEN_YET(80000, "功能暂未开放"),
    LAST_TIME_REQUEST_RUNNING(80001, "上次请求正在执行中"),

    OPERATE_ERROR(88888, "错误操作"),
    API_ALREADY_DISCARD(88889, "接口已废弃"),
    DATA_ERROR(88890, "数据错误"),

    SENTINEL_BLOCKHANDLER_ERROR(99993, "秒级触发限流"),
    REQUEST_PARAM_VALUES_ERROR(99994, "请求参数值域错误"),
    SERVER_REQUEST_METHOD_ERROR(99995, "请求方式Method不正确"),
    SERVER_OBJECT_PARAMS_INCONFORMITY(99996, "所传对象或其字段类型与后台不一致"),
    SERVER_AN_UNDEFINED_EXCEPTION(99997, "未定义的异常"),
    SERVER_REQUEST_URL_NOT_FOUND(99998, "请求地址不存在"),
    SERVER_ERROR(99999, "服务器异常");

    private int code;
    private String msg;

    ErrorCode(int code, String msg) {
        this.msg = msg;
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public int getCode() {
        return code;
    }

}
